<template>
  <div class="title-bar relative">
    <img @click="$router.back" v-if="showback" src="../assets/img/left-arrow.svg" class=" absolute left-[10px]" alt="">
      <slot></slot>
  </div>
</template>
<script setup>
  //showback决定了是否显示返回按钮，但是这个是否显示应该是由外边决定的
//defindProps就是定义从外边接收的值
defineProps({
    showback:{
        type:Boolean,
        default:false,
    },

})
</script>
<style scoped lang="scss">
@import "../assets/scss/comm.scss";
 .title-bar{
        height: 45px;
        background-color: $primaryColor;
        font-size: 18px;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
    }
</style>